const electron = require('electron');
const ipcMain = electron.ipcMain;
const head = 'migu/';
const miguMusic = require('migu-music-api').default;
module.exports = class migu {

    init() {

        ipcMain.handle(head+'recommend/playlist', async (event, args) => {

            return await miguMusic('recommend/playlist', { ...args})
        });
        ipcMain.handle(head+'playlist', async (event, args) => {
            return await miguMusic('playlist', { ...args})

        });
        ipcMain.handle(head+'song', async (event, args) => {

            return await miguMusic('song', { ...args})
        });
        ipcMain.handle(head+'search', async (event, args) => {
            return await miguMusic('search', { ...args})

        });
        ipcMain.handle(head+'album/songs', async (event, args) => {
            return await miguMusic('album/songs', { ...args})

        });
        ipcMain.handle(head+'singer/albums', async (event, args) => {

            return await miguMusic('singer/albums', { ...args})

        });

        ipcMain.handle(head+'lyric', async (event, args) => {
            return await miguMusic('lyric', { ...args})

        });

    }

}
